# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-frida-tools
_pkgname=frida-tools
pkgver=11.0.0
pkgrel=4
pkgdesc='Frida CLI tools.'
groups=('blackarch' 'blackarch-mobile' 'blackarch-binary' 'blackarch-reversing')
arch=('any')
url='https://pypi.org/project/frida-tools/#files'
license=('custom:unknown')
depends=('python2' 'python2-frida' 'python2-colorama' 'python2-prompt_toolkit'
         'python2-pygments' 'libimobiledevice')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
        'setup.py.patch')
sha512sums=('31ed33ea0a652f9f7c0055c1770663bbace60ef9e15446ddc71719878fee78b1907b63b7ca12527972a41f2021d770c77a4cc52ee8ed88c4c53a089f15298527'
            '48dc1d48f21e0d5672b7b628aca40c2431687608c4e228fbace9c88172b13103814af6ef9abebb4539fafa5700787b9af2c86b0c3b7988c805711db7458186e4')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  for i in "$pkgdir/usr/bin/"* ; do
    mv $i "${i}2"
  done
}

